window.onload = function() {
    //事件冒泡与捕获
    let div_child = document.getElementById("div_child")
    let div_parent = document.getElementById("div_parent")

    div_child.addEventListener("click", (e) => {
        e.stopPropagation()
        console.log("div_child被点击了")
    })
    div_parent.addEventListener("click", () => {
            console.log("div_parent被点击了")
        })
        // document.querySelectorAll("ul li")[0].addEventListener("click", (e) => {
        //     console.log(e.target.textContent)
        // })
    document.querySelectorAll("ul")[0].addEventListener("click", (e) => {
        console.log(e.target.innerText)
        console.log(e.currentTarget)
    })
    document.querySelector("p").addEventListener("click", (e) => {
        console.log(e.target.remove())
    })
    document.getElementsByTagName("a")[0].addEventListener("click", (e) => {
        e.preventDefault()
        console.log("a元素被点击")
    })


    console.log(document.documentElement)
    console.log(document.body)
    document.body.append("11111111")
    window.alert("hi")
}